package com.hcy.orderapi.manager.controller;

import com.hcy.order_domain.mapper.ServerOrderMapper;
import com.hcy.rabbitbasicmodel.dto.HomeData;
import com.hcy.rabbitbasicmodel.model.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author huchenying
 * @Description
 * @Date 2022/5/15
 **/
@RestController
@Slf4j
@RequestMapping("/homeData")
public class HomeDataController {

    @Autowired
    ServerOrderMapper serverOrderMapper;

    /**
     * @Author huchenying
     * @Description
     * @Date 2022/5/15 21:37
     **/
    @PostMapping("/getHomeData")
    public ResponseData<List<HomeData>> getHomeData(){
        ResponseData<List<HomeData>> responseData = new ResponseData<>();
        List<HomeData> data =  serverOrderMapper.getHomeData();
        return responseData.success(data);
    }
}
